﻿using AnesSystem.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace AnesSystem.Controls
{
    /// <summary>
    /// JianTou.xaml 的交互逻辑
    /// </summary>
    public partial class VerticalRedArrowLine : BaseDrugLineItemCtrl
    {
        #region Variables


        #endregion

        #region Constructor

        public VerticalRedArrowLine()
        {
            InitializeComponent();
            //_lineUp.Stroke = MyStroke;
            //_lineDn.Stroke = MyStroke;
            //_lineLeft.Stroke = MyStroke;
                       
            ThicknessUp = 2;
            ThicknessDn = 2;
            ThicknessLeft = 2;
            Yup = Y1 - 3;
            Ydn = Y1 + 3;
            this.Loaded += VerticalRedArrowLine_Loaded;
        }

        private void VerticalRedArrowLine_Loaded(object sender, RoutedEventArgs e)
        {            
            Xdn = X2 - 5;
            _speed.Margin = new Thickness(X1, 0, 0, 0);
        }

        #endregion

        #region Properties

        public double ThicknessLeft
        {
            get
            {
                return _lineLeft.StrokeThickness;
            }
            set
            {
                _lineLeft.StrokeThickness = value;

            }
        }
        public double ThicknessUp
        {
            get
            {
                return _lineUp.StrokeThickness;
            }
            set
            {
                _lineUp.StrokeThickness = value;

            }
        }

        public double ThicknessDn
        {
            get
            {
                return _lineDn.StrokeThickness;
            }
            set
            {
                _lineDn.StrokeThickness = value;

            }
        }
        #endregion

        #region 依赖属性


        public override double X2
        {
            get
            {
                return base.X2;
            }

            set
            {
                base.X2 = value;
                Xdn = X2 - 3;
            }
        }

        public double Xdn
        {
            get { return (double)GetValue(XdnProperty); }
            set { SetValue(XdnProperty, value); }
        }

        // Using a DependencyProperty as the backing store for X2.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty XdnProperty =
            DependencyProperty.Register("Xdn", typeof(double), typeof(VerticalRedArrowLine), new PropertyMetadata(1.0));

       

        public double Yup
        {
            get { return (double)GetValue(YupProperty); }
            set { SetValue(YupProperty, value ); }
        }

        // Using a DependencyProperty as the backing store for Y2.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty YupProperty =
            DependencyProperty.Register("Yup", typeof(double), typeof(VerticalRedArrowLine), new PropertyMetadata(1.0));


        public double Ydn
        {
            get { return (double)GetValue(YdnProperty); }
            set { SetValue(YdnProperty, value); }
        }

        // Using a DependencyProperty as the backing store for Y2.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty YdnProperty =
            DependencyProperty.Register("Ydn", typeof(double), typeof(VerticalRedArrowLine), new PropertyMetadata(1.0));

 
        #endregion

        #region Event

        #endregion

        #region Private Methods
            
        #endregion

        #region Public/Protected Methods

        #endregion

        #region EventHandlers

        #endregion
    }
}
